package 异常;

import org.junit.Test;

import java.io.IOException;

/**
 * @Author: SunAo
 * @Date: 2021/8/25 下午6:28
 */
public class 基本测试 {

    @Test
    public void 运行时异常(){
        System.out.println("hahah");
        throw new RuntimeException("Test");
    }


    @Test
    public void 捕获运行时异常(){
        System.out.println("hahah");
        try{
            throw new RuntimeException("Test");
        }catch (Exception ex){
            ex.printStackTrace();
        }

    }
}
